package fun.yao.common.uitls;

public class StrUtil {

    /**
     * 字符串加遮蔽
     * @param str
     * @param pos
     * @param count
     * @return
     */
    public static String GetFilterString(String str, int pos, int count){
        StringBuilder sb = new StringBuilder(str);
        for (int i = 0; i < count; i ++){
            int index = i + pos;
            if (index >=  str.length()){
                break;
            }
            else if (index < 0){
                continue;
            }
            sb.setCharAt(index, '*');
        }
        return sb.toString();
    }

}
